package com.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dao.AchievementDAO;
import com.pojo.Achievement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@SuppressWarnings("all")
@Service
public class AchievementService extends ServiceImpl<AchievementDAO, Achievement> {


    @Autowired
    private AchievementDAO achievementDAO;

    /**
     *  添加考试成绩
     * @param achievement  成绩信息
     * @return
     */
    public int addAchievement(Achievement achievement) {
        // 将学生考试成绩加入成绩表中
        int n=achievementDAO.insert(achievement);
        return n;
    }

    public IPage searchRewind(int page, int limit, Map m) {
        Page p = new Page(page,limit);
        return achievementDAO.searchRewind(p,m);
    }
}
